package top.mcwebsite.playandroid.business.search.impl.model

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.material3.IconButton
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.FavoriteBorder
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import top.mcwebsite.playandroid.common.uiWidget.skeleton
import top.mcwebsite.playandroid.strings.Str

@Composable
fun SkeletonSearchResultItem() {
    Column(
        modifier = Modifier
            .padding(horizontal = 12.dp, vertical = 5.dp)
    ) {
        Row(
            verticalAlignment = Alignment.CenterVertically,
            modifier = Modifier.padding(vertical = 2.dp)
        ) {
            Text(
                text = "骨架", modifier = Modifier
                    .width(50.dp)
                    .skeleton(true)
            )
            Spacer(modifier = Modifier.weight(1f))
            Text(
                text = "骨架", modifier = Modifier
                    .width(60.dp)
                    .skeleton(true)
            )
        }
        Text(
            text = "骨架", style = MaterialTheme.typography.titleMedium, modifier = Modifier
                .fillMaxWidth()
                .padding(vertical = 2.dp)
                .skeleton(true)
        )
        Row(
            verticalAlignment = Alignment.CenterVertically,
            modifier = Modifier.padding(vertical = 2.dp)
        ) {

            Text(
                text = "骨架", modifier = Modifier
                    .width(60.dp)
                    .skeleton(true)
            )
            Spacer(modifier = Modifier.weight(1f))
            IconButton(onClick = { /*TODO*/ }) {
                Icon(
                    Icons.Outlined.FavoriteBorder,
                    contentDescription = stringResource(id = Str.collection),
                    tint = Color.Red,
                    modifier = Modifier
                        .size(28.dp)
                        .skeleton(true)
                )
            }
        }
    }
}